package com.spcloud.fegin.fegin.impl;

import com.spcloud.common.entity.Order;
import com.spcloud.fegin.fegin.OrderService;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 实现fegin api接口
 * @author GuoChunbo
 * @create 2020-03-19 14:01
 * @Description: 类的描述
 */
@Component //扫描
public class OrderServiceImpl implements OrderService {

    //实现类里的方法就是请求方法失败后的默认回调

    @Override
    public String info() throws RuntimeException {
        return "Default Info";
    }

    @Override
    public List<Order> getOrderList() throws RuntimeException {
        List<Order> orderList = new ArrayList<>();

        orderList.add(new Order(11,"订单名称11"));
        orderList.add(new Order(12,"订单名称12"));
        orderList.add(new Order(13,"订单名称13"));
        orderList.add(new Order(14,"订单名称14"));
        orderList.add(new Order(15,"订单名称15"));
        return orderList;
    }
}
